![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
#include <Roe_all.h>
Public Member Functions | |
void | On_Expelled (Roe_Male *rival) |
void | On_NewHost (Roe_Male *host) |
void | On_ApproachOfDanger (int p_To_x, int p_To_y) |
bool | On_InHeat (Roe_Female *female, int p_x, int p_y) |
void | ClearFightlist () |
bool | SupplyHaveTerritory () |
Roe_Male * | SupplyHost () |
bool | On_Rank (Roe_Male *rival, double size, int age, int matings, bool where, bool range) |
virtual void | On_IsDead (Roe_Base *Someone, int whos_dead, bool fawn) |
void | AddSatellite (Roe_Male *sat) |
void | RemoveSatellite (Roe_Male *sat) |
void | Init (void) |
virtual void | BeginStep (void) |
virtual void | Step (void) |
virtual void | EndStep (void) |
Roe_Male (int x, int y, int size, int age, Roe_Female *mum, Landscape *L, RoeDeer_Population_Manager *RPM) | |
virtual | ~Roe_Male () |
![]() | |
Roe_Adult_Base (int x, int y, int size, int age, Landscape *L, RoeDeer_Population_Manager *RPM) | |
virtual | ~Roe_Adult_Base () |
![]() | |
unsigned | IsAlive () |
int | SupplyReserves () |
virtual void | On_MumAbandon (Roe_Female *) |
virtual void | On_EndGroup () |
virtual void | Send_IsDead () |
virtual void | On_ChangeGroup (int) |
virtual void | On_UpdateGroup (int, int) |
RoeDeerInfo | SupplyInfo () |
virtual int | WhatState () |
Roe_Base (int x, int y, Landscape *L, RoeDeer_Population_Manager *RPM) | |
virtual | ~Roe_Base () |
![]() | |
unsigned | SupplyFarmOwnerRef () |
AnimalPosition | SupplyPosition () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
virtual void | KillThis () |
virtual void | CopyMyself () |
void | SetX (int a_x) |
void | SetY (int a_y) |
TAnimal (int x, int y, Landscape *L) | |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual void | Dying () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
virtual bool | OnFarmEvent (FarmToDo) |
![]() | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
Public Attributes | |
int | m_MinInState [12] |
![]() | |
TRoeDeerStates | CurrentRState |
RoeDeer_Population_Manager * | m_OurPopulation |
int | m_Age |
int | m_Size |
int | m_RangeCentre_x |
int | m_RangeCentre_y |
int | m_Reserves |
double | m_HomeRange |
int | m_OldRange_x |
int | m_OldRange_y |
int | m_SearchRange |
bool | m_float |
bool | m_Disperse |
bool | m_HaveRange |
Roe_Female * | Mum |
int | m_ID |
int | m_FixlistNumber |
bool | m_Sex |
bool | m_IsDead |
unsigned | Alive |
Protected Member Functions | |
int | MOnMature (void) |
int | MDie (void) |
int | MDisperse (void) |
int | MEstablishRange (void) |
int | MOnNewDay (void) |
int | MEstablishTerritory (void) |
int | MFight (void) |
int | MAttendFemale (void) |
int | MFeed (void) |
int | MRun () |
int | MRecover (void) |
int | MEvade () |
int | MIgnore () |
int | MRuminate (void) |
int | MMate (void) |
int | MUpdateEnergy (void) |
![]() | |
bool | Running (int x, int y) |
void | Ignore (int p_To_x, int p_To_y) |
int | DistanceTo (int p_x, int p_y, int p_To_x, int p_To_y) |
int | DistanceToCC (int p_x, int p_y, int p_To_x, int p_To_y) |
int | DirectionTo (int p_x, int p_y, int p_To_x, int p_To_y) |
int | DirectionToCC (int p_x, int p_y, int p_To_x, int p_To_y) |
int | NextStep (int weight, int dir, int recurselevel) |
int | AssessHabitat (int polyref) |
int | AssessHabitat (int p_x, int p_y) |
int | LegalHabitat (int p_x, int p_y) |
int | LegalHabitatCC (int p_x, int p_y) |
int | Cover (int polyref) |
Calls the cover calculation for a given polyref. More... | |
int | Cover (int p_x, int p_y) |
Calls the cover calculation for a given x,y location. More... | |
int | CalcCover (TTypesOfLandscapeElement a_ele, int a_poly) |
The cover calculation for a given element type. More... | |
int | CoverCC (int p_x, int p_y) |
int | NutriValue (int polyref) |
int | NutriValue (int p_x, int p_y) |
int | NutriValueCC (int p_x, int p_y) |
int | Feeding (bool p_Disperse) |
void | SeekCover (int threshold) |
void | SeekNutri (int p_threshold) |
int | ProbRoadCross (int p_x, int p_y, int p_width) |
double | CalculateRoadMortality (int p_x, int p_y, int p_width) |
void | WalkTo (int pos_x, int pos_y) |
void | WalkToCC (int pos_x, int pos_y) |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Protected Attributes | |
Roe_Female * | m_My_Mate |
bool | m_HaveTerritory |
int | m_NoOfMatings |
int | m_NumberOfFights |
int | m_MyFightlist |
Roe_Male * | m_MyTMale |
Roe_Male * | m_MySatellites [50] |
![]() | |
bool | m_DestinationDecided |
int | m_NewState |
int | m_DispCount |
int | m_float_x |
int | m_float_y |
![]() | |
int | timestep |
int | m_Cross_x |
int | m_Cross_y |
double | m_EnergyGained |
int | m_RecovCount |
int | m_RumiCount |
int | m_FeedCount |
int | m_LengthFeedPeriod |
int | m_LengthRuminate |
int | m_LastState |
int | m_danger_x |
int | m_danger_y |
int | m_distrc |
int | m_weightedstep |
int | SimW |
int | SimH |
![]() | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
![]() | |
int | m_CurrentStateNo |
The basic state number for all objects - '-1' indicates death. More... | |
bool | m_StepDone |
Indicates whether the iterative step code is done for this timestep. More... | |
Roe_Male::Roe_Male | ( | int | x, |
int | y, | ||
int | size, | ||
int | age, | ||
Roe_Female * | mum, | ||
Landscape * | L, | ||
RoeDeer_Population_Manager * | RPM | ||
) |
Roe_Male::Roe_Male - constructor for male object. Sets all attributes. It also adds fawns to mother's offspring list.
References Roe_Base::IsAlive(), Roe_Base::m_Age, Roe_Base::m_HaveRange, m_HaveTerritory, Roe_Base::m_IsDead, Roe_Base::m_LastState, m_MinInState, m_My_Mate, m_MyFightlist, m_MySatellites, m_MyTMale, Roe_Female::m_MyYoung, m_NoOfMatings, m_NumberOfFights, TAnimal::m_OurLandscape, Roe_Base::m_Reserves, Roe_Base::m_Sex, Roe_Base::m_Size, Roe_Base::Mum, random(), and Landscape::Warn().
|
virtual |
References m_My_Mate, and Roe_Base::Mum.
void Roe_Male::AddSatellite | ( | Roe_Male * | sat | ) |
Roe_Male::AddSatellite - adds satellite male to a male object's satellite male list.
References Roe_Base::IsAlive(), m_MySatellites, TAnimal::m_OurLandscape, and Landscape::Warn().
Referenced by MEstablishRange(), and On_NewHost().
|
virtual |
Roe_Male::BeginStep goes through all male objects in the populations. Male objects holding a territory, (in the territorial season, March 1st - Sept. 1st) check territory for other male objects every 4 hours. OnRank() keep track of male ranks. These ranks lasts for the rest of that season (i.e. m_FightList is cleared once a year). Young satellite males always try to stay clear of their older host and check distance every timestep and evade if too close Calls SupplyMonth(), SupplyMales(), On_Rank(), AddToFightList(), SupplyPosition(), DistanceTo().
Reimplemented from Roe_Adult_Base.
References RoeDeer_Population_Manager::AddToFightlist(), Roe_Base::CurrentRState, Roe_Base::DistanceTo(), Roe_Base::IsAlive(), Roe_Base::m_Age, m_HaveTerritory, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, m_MyFightlist, m_MyTMale, m_NoOfMatings, m_NumberOfFights, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_SearchRange, Roe_Base::m_Size, AnimalPosition::m_x, AnimalPosition::m_y, rds_MDeathState, rds_MEvade, RoeDeer_Population_Manager::SupplyMales(), Landscape::SupplyMonth(), TAnimal::SupplyPosition(), Roe_Base::timestep, and Landscape::Warn().
void Roe_Male::ClearFightlist | ( | ) |
References m_MyFightlist, and m_NumberOfFights.
Referenced by RoeDeer_Population_Manager::DoFirst().
|
virtual |
Roe_Male::EndStep - checks if male object is dead and adds to number of timesteps. If 1 whole day has passed, current state is set to FOnNewDay
Reimplemented from Roe_Adult_Base.
References Roe_Base::CurrentRState, Roe_Base::IsAlive(), TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_weightedstep, rds_MDeathState, rds_MOnNewDay, RoeDeer_Population_Manager::StepCounter, Roe_Base::timestep, and Landscape::Warn().
void Roe_Male::Init | ( | void | ) |
|
protected |
Roe_Male::MAttendFemale - function for male attending female in heat. Checks if has mate, if not return to feeding. If has a mate, male stays in this state (attend female) until new day. Then he returns to normal activity. The male will attend to the female, and follow her closely. He does not eat during that day and looses energy comparable to walking. Calls SupplyPosition(), WalkTo().
References Roe_Base::IsAlive(), Roe_Base::m_LastState, m_MinInState, m_My_Mate, TAnimal::m_OurLandscape, AnimalPosition::m_x, AnimalPosition::m_y, TAnimal::SupplyPosition(), Roe_Base::WalkTo(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MDie - function for managing death of a male object. The male object removes itself from all fightlists and deletes its own fightlist. The fixlist of the male object is emptied and the male furthermore adds itself to list of dead animals. If a territoryholder sends message to every male in the neighbourhood abput death. Messages potential mate and satellite males about death. Function returns dead state. Calls functions DeleteFightList(), RemoveFromFightList(), RemoveFixList()and On_IsDead().
References RoeDeer_Population_Manager::DeadList, RoeDeer_Population_Manager::DeleteFightlist(), Roe_Base::IsAlive(), Roe_Base::m_Age, TALMaSSObject::m_CurrentStateNo, Roe_Base::m_FixlistNumber, m_HaveTerritory, TAnimal::m_Location_x, TAnimal::m_Location_y, m_My_Mate, m_MyFightlist, m_MySatellites, m_MyTMale, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_SearchRange, Roe_Base::Mum, Roe_Female::On_IsDead(), On_IsDead(), RoeDeer_Population_Manager::RemoveFixList(), RoeDeer_Population_Manager::RemoveFromFightlist(), RoeDeer_Population_Manager::SupplyMales(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MDisperse - models dispersal state of male objects. Removes satellite males, sets state to dispersal. It then keeps track of amount of time in the dispersal state and calculates probability of switching to feeding, keep dispersing, or dying if spending too long in dispersal state.Calls functions RemoveSatellite(), DirectionTo(), NextStep().
References Roe_Base::DirectionTo(), Roe_Base::IsAlive(), Roe_Adult_Base::m_DispCount, Roe_Base::m_Disperse, Roe_Base::m_HaveRange, m_HaveTerritory, Roe_Base::m_LastState, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, m_MyTMale, Roe_Base::m_OldRange_x, Roe_Base::m_OldRange_y, TAnimal::m_OurLandscape, Roe_Base::m_RangeCentre_x, Roe_Base::m_RangeCentre_y, Roe_Base::NextStep(), random(), RemoveSatellite(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MEstablishRange - sets up range for male object. Contrary to the females, males does not just set up range in their mothers´territory. They have to position themselves according to the distribution of male territories in the area. Two strategies: 1)satellite and 2)periphere. Males heavier than average for their age class choose satellite and set rangecentre= oldest male in area. Others choose periphere and avoid other males. Sets range center. Returns state feed. Calls functions SupplyTMales(), SupplyInfo(), AddSatellite()
References AddSatellite(), Roe_Base::IsAlive(), RoeDeerInfo::m_Age, Roe_Adult_Base::m_DispCount, Roe_Base::m_Disperse, Roe_Base::m_float, Roe_Base::m_HaveRange, TAnimal::m_Location_x, TAnimal::m_Location_y, RoeDeer_Population_Manager::m_MaleDispThreshold, m_MinInState, m_MyTMale, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, RoeDeerInfo::m_Range_x, RoeDeerInfo::m_Range_y, Roe_Base::m_RangeCentre_x, Roe_Base::m_RangeCentre_y, Roe_Base::m_Size, and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MEstablishTerritory - establishment of territory by male object. If male object is satellite male, the male challenges his host and adds him to fightlist. If Male is stronger it takes over the territory, otherwise no territory. If not a satellite male check all nearby males and establish rank by fighting them. If win take over their territory. Always returns state feeding. Calls AddToFightList(), On_Rank(), On_Expelled(), SupplyInfo(), SupplyTMales(),
References RoeDeer_Population_Manager::AddToFightlist(), Roe_Base::IsAlive(), Roe_Base::m_Age, Roe_Adult_Base::m_DispCount, Roe_Base::m_Disperse, m_HaveTerritory, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, m_MyFightlist, m_MyTMale, m_NoOfMatings, m_NumberOfFights, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, RoeDeerInfo::m_Range_x, RoeDeerInfo::m_Range_y, Roe_Base::m_RangeCentre_x, Roe_Base::m_RangeCentre_y, Roe_Base::m_SearchRange, Roe_Base::m_Size, On_Expelled(), On_Rank(), Roe_Base::SupplyInfo(), RoeDeer_Population_Manager::SupplyTMales(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MEvade - checks direction to threath and takes 50 steps in opposite direction. Returns to same state as before disturbance. Calls DirectionTo(), NextStep()
References Roe_Base::DirectionTo(), Roe_Base::IsAlive(), Roe_Base::m_danger_x, Roe_Base::m_danger_y, Roe_Base::m_LastState, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, TAnimal::m_OurLandscape, Roe_Base::NextStep(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MFeed - Models feeding of male object, including energy budget and search for better feeding area. Also determines need to ruminate. In theory a roe deer can spend time in more than 1 type of habitat within 1 timestep. For the energy budget only the habitat type where roe deer is at the beginning of each time step is recorded. Need to keep counter of minutes in feed since the end of last ruminating period (m_FeedCount) to know when to return to ruminate. Returns values for dispersal, ruminate or keep feeding (or die). Calls function NutriValue()
References Roe_Base::Feeding(), IntakeRate, Roe_Base::IsAlive(), Roe_Base::m_Disperse, Roe_Base::m_EnergyGained, Roe_Base::m_FeedCount, Roe_Base::m_IsDead, Roe_Base::m_LastState, Roe_Base::m_LengthFeedPeriod, Roe_Base::m_LengthRuminate, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, TAnimal::m_OurLandscape, MinNutri, Roe_Base::NutriValue(), random(), Roe_Base::SeekNutri(), Landscape::SupplyMonth(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MFight -add 1 to time spend in this state and returns feeding state.
References Roe_Base::IsAlive(), m_MinInState, TAnimal::m_OurLandscape, and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MIgnore - Ignore threath and adds 1 to time spend in this state. Return to same state as before disturbance
References Roe_Base::IsAlive(), Roe_Base::m_LastState, m_MinInState, TAnimal::m_OurLandscape, and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MMate - add 1 to number of matings, stop attending female. Return to feed
References Roe_Base::IsAlive(), m_MinInState, m_My_Mate, m_NoOfMatings, TAnimal::m_OurLandscape, and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MOnMature - Checks if area is good enough to establish range. The function ScanGrid() adds the quality values stored in m_grid starting with a minimum area of 400 x 400 m. If not sufficient it extends outwards in all directions until max range is reached (800 x 800 m). It also checks if amount of other males nearby is below a male density threshold. It returns the size of the resulting area if good enough and 0 if not good enough Calls ScanGrid(), SupplyMaleRC().
References Roe_Base::IsAlive(), TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_SearchRange, MaleDensityThreshold, RoeDeer_Population_Manager::ScanGrid(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MOnNewDay - updates age of male object (+ 1 day), decides if life expectancy has been reached, which depends on age (Floaters have a higher mortality (added FloatMort)). Checks whether dispersers and floaters can set up range by checking habitat, closeness to mothers range and amount of males already in the area. If failed to find a range before october 1st become a floater. Also governs establishement of territory dependent on age. Returns values to set the following states: establish range, establish territory, mate, update energy (and die). Calls functions DistanceTo(), ScanGrid(), SupplyMaleRC().
References Roe_Base::DistanceTo(), FloatMort, Roe_Base::IsAlive(), Roe_Base::m_Age, Roe_Adult_Base::m_DestinationDecided, Roe_Base::m_Disperse, Roe_Base::m_float, Roe_Adult_Base::m_float_x, Roe_Adult_Base::m_float_y, Roe_Base::m_HaveRange, m_HaveTerritory, TAnimal::m_Location_x, TAnimal::m_Location_y, m_My_Mate, Roe_Adult_Base::m_NewState, Roe_Base::m_OldRange_x, Roe_Base::m_OldRange_y, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_SearchRange, MaleDensityThreshold, MaleDMR, MinDispDistance, random(), RoeDeer_Population_Manager::ScanGrid(), Landscape::SupplyDayInYear(), RoeDeer_Population_Manager::SupplyMaleRC(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MRecover - Governs recovery after running from danger. Function counts amount of time in state during the present period of recovovery (m_RecovCount) and sets this to 0 when state is left. Female only transfers to this state if safe, whichs means in good habitat. Returns states: feeding, recovery.
References AverageRecoveryTime, Roe_Base::IsAlive(), Roe_Base::m_FeedCount, Roe_Base::m_LastState, m_MinInState, TAnimal::m_OurLandscape, Roe_Base::m_RecovCount, MaxRecoveryTime, random(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MRuminate - Function for ruminating. Checks for got spot to rest and amount of time spent ruminating. Ruminate activity cannot be seperated from other kinds of inactivity. It is also assumed that ruminating takes place while recovering after disturbance. Need to count amount of time spend in this state during this period of ruminating and in total last 24 hrs. Returns values for either stay ruminating, feed or dispersal (or die).Calls function Cover().
References Roe_Base::Cover(), CoverThreshold1, CoverThreshold2, Roe_Base::IsAlive(), Roe_Base::m_Disperse, Roe_Base::m_IsDead, Roe_Base::m_LastState, Roe_Base::m_LengthRuminate, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, TAnimal::m_OurLandscape, Roe_Base::m_RumiCount, random(), Roe_Base::SeekCover(), Landscape::SupplyMonth(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MRun - Sets the male object to be in a running state - and checks if safe after 1 time step in this state. Calls Running().
References Roe_Base::IsAlive(), Roe_Base::m_danger_x, Roe_Base::m_danger_y, Roe_Base::m_IsDead, m_MinInState, TAnimal::m_OurLandscape, Roe_Base::m_RecovCount, Roe_Base::Running(), and Landscape::Warn().
Referenced by Step().
|
protected |
Roe_Male::MUpdateEnergy - Calculates how much energy is used (in cal/minute) in different activities. Calculates net energy (gained-used) and determines whether excess enery is added to reserves or is used to put on weight. A negative net energy causes the male object to loose weight - if roe deer weight falls below a minimum value, the deer will die. If the roe deer is in very bad condition, forage time is increased. returns states such as mate, feed, newState or die.
References Anabolic_Inv, Catabolic_Inv, CostMaleAct, Roe_Base::IsAlive(), RoeDeer_Population_Manager::m_CriticalWeight_Males, Roe_Base::m_EnergyGained, Roe_Base::m_LastState, Roe_Base::m_LengthFeedPeriod, m_MinInState, RoeDeer_Population_Manager::m_MinWeight_Males, Roe_Adult_Base::m_NewState, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_Reserves, Roe_Base::m_Size, Male_FeedBouts, MaleRMR, Landscape::SupplyMonth(), and Landscape::Warn().
Referenced by Step().
void Roe_Male::On_ApproachOfDanger | ( | int | p_To_x, |
int | p_To_y | ||
) |
Roe_Male::On_ApproachOfDanger - Determines whether to run or evade a threat depending on cover and distance to threath. In good cover, male will run if threath is less than 30 m away and else perform evasive behavior, In intermediate cover the flight distance is 50 m, and in poor cover it is 70 m. Returns states evade or run. Calls Cover(), DistanceTo().
References Roe_Base::Cover(), CoverThreshold1, CoverThreshold2, Roe_Base::CurrentRState, Roe_Base::DistanceTo(), Roe_Base::m_danger_x, Roe_Base::m_danger_y, TAnimal::m_Location_x, TAnimal::m_Location_y, rds_MEvade, and rds_MRun.
void Roe_Male::On_Expelled | ( | Roe_Male * | rival | ) |
Following the On_Rank() function - if a male territory holder loses a fight and gets expelled from his territory. Clears satellite list, sets object to be a floater and current state to dispersal Calls OnNewHost().
References Roe_Base::CurrentRState, Roe_Base::IsAlive(), Roe_Base::m_float, Roe_Adult_Base::m_float_x, Roe_Adult_Base::m_float_y, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MySatellites, TAnimal::m_OurLandscape, On_NewHost(), rds_MDisperse, and Landscape::Warn().
Referenced by MEstablishTerritory(), and On_Rank().
bool Roe_Male::On_InHeat | ( | Roe_Female * | female, |
int | p_x, | ||
int | p_y | ||
) |
Roe_Male::On_InHeat - response of male object to "In Heat" message sent by female object. Check if already have mate and if not check if distance to female is too large. If not too large, the male checks for rivals around, checks rank (also dependent on whether he is in his own territory), challenges them and adds them to fightlist. If the male wins, he will attend the female otherwise he will give up attending this female. Calls SupplyTMales(), DistanceTo(), On_Rank(), AddToFightList().
References RoeDeer_Population_Manager::AddToFightlist(), Roe_Base::CurrentRState, Roe_Base::DistanceTo(), Roe_Base::IsAlive(), Roe_Base::m_Age, TAnimal::m_Location_x, TAnimal::m_Location_y, m_My_Mate, m_MyFightlist, m_NoOfMatings, m_NumberOfFights, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, Roe_Base::m_RangeCentre_x, Roe_Base::m_RangeCentre_y, Roe_Base::m_Size, rds_MAttendFemale, RoeDeer_Population_Manager::SupplyTMales(), Roe_Base::WalkTo(), and Landscape::Warn().
|
virtual |
Roe_Male::On_IsDead - governs a male objects "response" to death of another object. Checks who is dead (mom, male, mate) and sets them to NULL. If a male object is dead, the "responding" male object checks if dead object is host ("responding" object is satellite male). If so it will send message to the dead host's other satellites. Rank is checked among satellites and if "responding" male wins a fight, he will take over territory of dead male. If the dead object is a satellite of the "responding" male, it will be removed from satellite list. If dead object holds a territory and "responding" male is not a satellite to the dead object but is also not a territory holder, he can challenge nearby interested males (also without territory) and win territory. Herefter if satellite to another host, the "responding" male will send a message and remove itself from satellite list. If dead object is the "responding" male's mate, the "responding" male will seize to attend the female. Calls On-Rank(), SupplyInfo(), SupplyMales(), RemoveSatellites().
Reimplemented from Roe_Base.
References Roe_Base::CurrentRState, Roe_Base::IsAlive(), Roe_Base::m_Age, Roe_Adult_Base::m_DispCount, Roe_Base::m_Disperse, m_HaveTerritory, m_MinInState, m_My_Mate, m_MySatellites, m_MyTMale, m_NoOfMatings, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, RoeDeerInfo::m_Range_x, RoeDeerInfo::m_Range_y, Roe_Base::m_RangeCentre_x, Roe_Base::m_RangeCentre_y, Roe_Base::m_SearchRange, Roe_Base::m_Size, Roe_Base::Mum, On_Rank(), rds_MFeed, RemoveSatellite(), SupplyHaveTerritory(), Roe_Base::SupplyInfo(), RoeDeer_Population_Manager::SupplyMales(), and Landscape::Warn().
Referenced by Roe_Female::FDie(), and MDie().
void Roe_Male::On_NewHost | ( | Roe_Male * | host | ) |
Roe_Male::On_NewHost - assigns new host to satellite male by adding satellite to host's satellite list and setting host to new host. Calls AddSatellite().
References AddSatellite(), Roe_Base::IsAlive(), m_MyTMale, TAnimal::m_OurLandscape, and Landscape::Warn().
Referenced by On_Expelled().
bool Roe_Male::On_Rank | ( | Roe_Male * | rival, |
double | size, | ||
int | age, | ||
int | matings, | ||
bool | where, | ||
bool | range | ||
) |
Roe_Male::On_Rank is used to establish ranks between male object and rival male object. The rank is dependent on male size, age, whether the males is in his own territory, number of previous matings,and number of previous fights. It also checks for location (if in adversarys territory, winning male can expell territory holder - and call On_Expelled()). If male object is taking over a territory from a rival male, the male object will receive the rival's list of satllite males. Calls AddToFightlist(), DistanceTo(), SupplyInfor(), On_Expelled(), RemoveSatellite().
References RoeDeer_Population_Manager::AddToFightlist(), Roe_Base::DistanceTo(), Roe_Base::m_Age, Roe_Adult_Base::m_DispCount, Roe_Base::m_Disperse, Roe_Base::m_float, Roe_Base::m_HaveRange, m_HaveTerritory, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinInState, m_MyFightlist, m_MyTMale, m_NoOfMatings, m_NumberOfFights, TAnimal::m_OurLandscape, Roe_Base::m_OurPopulation, RoeDeerInfo::m_Range_x, RoeDeerInfo::m_Range_y, Roe_Base::m_RangeCentre_x, Roe_Base::m_RangeCentre_y, Roe_Base::m_Size, MalePrime, On_Expelled(), random(), RemoveSatellite(), Roe_Base::SupplyInfo(), and Landscape::Warn().
Referenced by MEstablishTerritory(), and On_IsDead().
void Roe_Male::RemoveSatellite | ( | Roe_Male * | sat | ) |
Roe_Male::RemoveSatellite - clears the list of satellite males that belongs to a male object
References Roe_Base::IsAlive(), m_MySatellites, TAnimal::m_OurLandscape, and Landscape::Warn().
Referenced by MDisperse(), On_IsDead(), and On_Rank().
|
virtual |
Roe_Male::Step - function called every time step. The functions checks if done with a given state (m_StepDone) and governs states and transitions to other states. Calls functions: MOnMature(), MDie(), MOnNewDay(), MMate(), MEstablishRange(), MEstablishTerritory(), MDisperse(), MFeed(), MRecover(), MRUn(), MEvade(), MIgnore(), MRuminate(), MFight(), MAttendFemale(), MUpdateEnergy()
Reimplemented from Roe_Adult_Base.
References Roe_Base::CurrentRState, Roe_Base::IsAlive(), TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, MAttendFemale(), MDie(), MDisperse(), MEstablishRange(), MEstablishTerritory(), MEvade(), MFeed(), MFight(), MIgnore(), MMate(), MOnMature(), MOnNewDay(), MRecover(), MRuminate(), MRun(), MUpdateEnergy(), rds_Initialise, rds_MAttendFemale, rds_MDeathState, rds_MDie, rds_MDisperse, rds_MEstablishRange, rds_MEstablishTerritory, rds_MEvade, rds_MFeed, rds_MFight, rds_MIgnore, rds_MMate, rds_MOnMature, rds_MOnNewDay, rds_MRecover, rds_MRuminate, rds_MRun, rds_MUpdateEnergy, and Landscape::Warn().
|
inline |
Referenced by On_IsDead(), and RoeDeer_Population_Manager::SupplyTMales().
|
protected |
Referenced by BeginStep(), MDie(), MDisperse(), MEstablishTerritory(), MOnNewDay(), On_IsDead(), On_Rank(), and Roe_Male().
int Roe_Male::m_MinInState[12] |
Referenced by BeginStep(), MAttendFemale(), MDisperse(), MEstablishRange(), MEstablishTerritory(), MEvade(), MFeed(), MFight(), MIgnore(), MMate(), MRecover(), MRuminate(), MRun(), MUpdateEnergy(), On_IsDead(), On_Rank(), and Roe_Male().
|
protected |
Referenced by MAttendFemale(), MDie(), MMate(), MOnNewDay(), On_InHeat(), On_IsDead(), Roe_Male(), and ~Roe_Male().
|
protected |
Referenced by BeginStep(), ClearFightlist(), MDie(), MEstablishTerritory(), On_InHeat(), On_Rank(), and Roe_Male().
|
protected |
Referenced by AddSatellite(), MDie(), On_Expelled(), On_IsDead(), RemoveSatellite(), and Roe_Male().
|
protected |
Referenced by BeginStep(), MDie(), MDisperse(), MEstablishRange(), MEstablishTerritory(), On_IsDead(), On_NewHost(), On_Rank(), and Roe_Male().
|
protected |
Referenced by BeginStep(), MEstablishTerritory(), MMate(), On_InHeat(), On_IsDead(), On_Rank(), and Roe_Male().
|
protected |
Referenced by BeginStep(), ClearFightlist(), MEstablishTerritory(), On_InHeat(), On_Rank(), and Roe_Male().